<template>
	<view>
		<!-- 优惠明细 -->
		<view>
			<!-- 商品信息 -->
			<view class="g-item">
				<!-- 商品图片 -->
				<!-- <image src="/static/index2.png" mode="aspectFill" class="goodsimg"></image> -->
				<view class="right">
					<!-- 商品名称 -->
					<!-- <view class="kd_name">快递公司</view> -->
					<view class="kd_num">
						<text>快递单号:</text>
						<text style="padding-left: 20rpx;">{{order}}</text>
						<text class="fuzhi" @click="copy">复制</text>
					</view>
				</view>
			</view>
		</view>
		<!-- 收货地址 -->
		<!-- <view class="sh_address">收货地址：安徽省合肥市包河区义城街道高速中央广场E座1808室</view> -->
		<!-- 物流信息 -->
		<view class="uni-timeline" style="padding: 30upx 40upx; background-color: #fff;">
			<view class="wuliu_box">
				<view class="wuliu_add_box" v-for="(item,index) in list">
					<view class="dian " :class="{'maxdian':index==0}"></view>

					<view class="wuliu_time">{{item.context}}</view>
				</view>
			</view>
			<!-- <view>暂无物流信息</view> -->
		</view>
	</view>
	</view>
</template>

<script>
	import uniCopy from '@/js_sdk/uni-copy.js';
	import {wuliu,ptwuliu} from"../../api/product.js"
	export default {
		components: {},
		data() {
			return {
				order:"",
				id:'',
				list:[],
				type:1//0拼团 1 正常
			}
		},
		filters: {
			time(val) {
				return val == 0 ? '暂未操作' : moment(val * 1000).format('YYYY-MM-DD HH:mm:ss')
			}
		},
		onLoad(e) {
			if(e.type){
				this.type=e.type
			}
			console.log(e)
			this.id=e.id
			this.order=e.order
			this.getOrder()
		},
		methods: {
			async getOrder(){
				let url=wuliu
				if(this.type==0){
					url=ptwuliu
				}
				let res=await this.get(url,{expressNum:this.order,expressId:this.id})
				this.list=JSON.parse(res.data).data
				console.log(this.list)
			},
			copy() {
				uniCopy({
					content:this.order,
					success: (res) => {
						uni.showToast({
							title: '复制成功',
							icon: 'none',
							duration: 2000,
						})
					},
					error: (e) => {
						uni.showToast({
							title: e,
							icon: 'none',
							duration: 3000,
						})
					}
				})
			}
		}
	}
</script>

<style>
	.goodsimg {
		width: 90rpx;
		height: 90rpx;
		margin-right: 30rpx;
	}

	.g-item {
		display: flex;
		padding: 60rpx 30rpx 40rpx;
		align-items: center;
	}

	.kd_name {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #F0812D;
		position: relative;
		top: -10rpx;
	}

	.kd_num {
		font-size: 26rpx;
		font-weight: 500;
		color: #000000;
		width: 500rpx;
		margin-top: 10rpx;
	}

	.fuzhi {
		display: inline-block;
		text-align: center;
		width: 84rpx;
		height: 36rpx;
		background: #F6F6F6;
		border-radius: 16rpx;
		margin-left: 40rpx;
		font-size: 22rpx;
		line-height: 36rpx;
	}

	.sh_address {
		padding: 20rpx 30rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
	}

	.wuliu_icon1 {
		width: 30rpx;
		height: 30rpx;
		background-color: #D6D6D6;
		border-radius: 30rpx;
		position: relative;
		left: -16rpx;
	}

	.wuliu_top {
		position: relative;
		border-left: 1rpx solid #D6D6D6;
		padding-bottom: 10rpx;
		display: flex;
		align-items: center;
		font-size: 28rpx;
		font-weight: bold;
		color: #666666;
	}

	.wuliu_add {
		width: 100%;
		margin-left: 10rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #666666;
	}

	.wuliu_time {

		font-size: 22rpx;
		font-weight: 400;
		color: #666666;
		padding-left: 20rpx;
	}

	.wuliu_add_box {
		border-left: 1rpx solid #D6D6D6;
		padding-left: 20rpx;
		position: relative;
		padding-bottom: 54rpx;
	}

	.dian {
		width: 14rpx;
		height: 14rpx;
		background: #D6D6D6;
		border-radius: 50%;
		position: absolute;
		left: -8rpx;
		top: 0rpx;
	}
	.maxdian{
		width: 26rpx;
		height: 26rpx;
		border: 24rpx;
		background-color:#F0812D ;
		left: -14rpx;
	}
	.wuliu_name {
		line-height: 28rpx;
	}
</style>
